{extend name="public:layout" /}
{block name="title"}发票管理{/block}
{block name="head"}
<style>
    .area_name select{width:33%;float:left;}
</style>
{/block}
{block name="body"}
<div class="wrapper wrapper-content">
    <div class="ibox">
        <div class="ibox-title">
            <ol class="breadcrumb">
                <li><a href="index"><i class="fa fa-hand-o-right"></i> 发票列表</a></li>
            </ol>
        </div>
        <div class="ibox-content">
            <form method="post" class="form-horizontal" id="form">
                <input name="order_id" type="hidden" value="{$info['order_id']}"/>
                <div class="form-group">
                    <label class="col-sm-2 control-label Validform_label">发票类型</label>
                    <div class="col-sm-4">
                        <p class="form-control-static">
                            {eq name="info['invoice_info']['inv_state']" value="1"}普通发票{/eq}
                            {eq name="info['invoice_info']['inv_state']" value="2"}增值税发票{/eq}
                        </p>
                    </div>
                </div>
                {eq name="info.invoice_info.inv_state" value="1"}
                <div class="form-group">
                    <label class="col-sm-2 control-label Validform_label">发票抬头</label>
                    <div class="col-sm-4">
                        <input type="text" class="form-control" name="invoice_info[inv_title]" value="{$info['invoice_info']['inv_title']}" />
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label Validform_label">纳税人识别号</label>
                    <div class="col-sm-4">
                        <input type="text" class="form-control" name="invoice_info[inv_code]" value="{$info['invoice_info']['inv_code']}" />
                    </div>
                </div>
                {/eq}
                {eq name="info.invoice_info.inv_state" value="2"}
                <div class="form-group">
                    <label class="col-sm-2 control-label Validform_label">单位名称</label>
                    <div class="col-sm-4">
                        <input type="text" class="form-control" name="invoice_info[inv_title]" value="{$info['invoice_info']['inv_title']}" />
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label Validform_label">纳税人识别号</label>
                    <div class="col-sm-4">
                        <input type="text" class="form-control" name="invoice_info[inv_code]" value="{$info['invoice_info']['inv_code']}" />
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label Validform_label">注册地址</label>
                    <div class="col-sm-4">
                        <input type="text" class="form-control" name="invoice_info[inv_info][inv_reg_addr]" value="{$info.invoice_info.inv_info.inv_reg_addr}" />
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label Validform_label">注册电话</label>
                    <div class="col-sm-4">
                        <input type="text" class="form-control" name="invoice_info[inv_info][inv_reg_phone]" value="{$info.invoice_info.inv_info.inv_reg_phone}" />
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label Validform_label">开户银行</label>
                    <div class="col-sm-4">
                        <input type="text" class="form-control" name="invoice_info[inv_info][inv_reg_bank]" value="{$info.invoice_info.inv_info.inv_reg_bank}" />
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label Validform_label">开户帐号</label>
                    <div class="col-sm-4">
                        <input type="text" class="form-control" name="invoice_info[inv_info][inv_reg_account]" value="{$info.invoice_info.inv_info.inv_reg_account}" />
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label Validform_label">相关资料</label>
                    <div class="col-sm-4">
                        <input type="hidden" class="form-control" name="invoice_info[inv_info][inv_file]" value="{$info.invoice_info.inv_info.inv_file}" />
                        <p class="form-control-static">
                            <a href="{$info.invoice_info.inv_info.inv_file}" target="_blank">查看资料</a>
                        </p>
                    </div>
                </div>
                {/eq}
                <div class="form-group">
                    <label class="col-sm-2 control-label Validform_label">收货人</label>
                    <div class="col-sm-4">
                        <input type="text" class="form-control" name="invoice_info[inv_info][addr_consignee]" value="{$info.invoice_info.inv_info.addr_consignee}" />
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label Validform_label">联系电话</label>
                    <div class="col-sm-4">
                        <input type="text" class="form-control" name="invoice_info[inv_info][addr_tel]" value="{$info.invoice_info.inv_info.addr_tel}" />
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label Validform_label">寄送区域</label>
                    <div class="col-sm-4">
                        <div class="area_name">
                            <select id="prov_id" name="invoice_info[inv_info][addr_prov_id]" class="form-control"></select>
                            <select id="city_id" name="invoice_info[inv_info][addr_city_id]" class="form-control"></select>
                            <select id="dist_id" name="invoice_info[inv_info][addr_dist_id]" class="form-control"></select>
                            <script>
                                In('address',function () {
                                    addressInit(
                                        'prov_id', 'city_id', 'dist_id',
                                        '{$info.invoice_info.inv_info.addr_prov_id}','{$info.invoice_info.inv_info.addr_city_id}','{$info.invoice_info.inv_info.addr_dist_id}');
                                })
                            </script>
                        </div>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label Validform_label">详细地址</label>
                    <div class="col-sm-4">
                        <input type="text" class="form-control" name="invoice_info[inv_info][addr_address]" value="{$info.invoice_info.inv_info.addr_address}" />
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label Validform_label">是否开票</label>
                    <div class="col-sm-4">
                        <label class="radio-inline i-checks">
                            <input type="radio" name="invoice" value="1" {eq name="info.invoice" value="1"}checked{/eq}> 未开票
                        </label>
                        <label class="radio-inline i-checks">
                            <input type="radio" name="invoice" value="2" {eq name="info.invoice" value="2"}checked{/eq}> 已开票
                        </label>
                        <label class="radio-inline i-checks">
                            <input type="radio" name="invoice" value="3" {eq name="info.invoice" value="3"}checked{/eq}> 已寄出
                        </label>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label Validform_label">开票号码</label>
                    <div class="col-sm-4">
                        <input type="text" class="form-control" name="invoice_sn" value="{$info['invoice_sn']}" />
                    </div>
                </div>
                <div class="form-group">
                    <div class="col-sm-10 col-sm-offset-2">
                        <button class="btn btn-primary" type="button" id="btnSub">保存内容</button>
                        <a href="{:url('index')}" class="btn btn-white">取消</a>
                        <span id="validError"></span>
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>
{/block}
{block name="script"}
<script type="text/javascript">
    $(function () {
        iCheck();
        ajaxSubForm('#btnSub');
    })
</script>
{/block}